<?php 
 /**
 * @author mago
 */

function smarty_modifier_dateMod($string, $format='d-m-Y, H:i') {
 
	if($string == '0000-00-00 00:00:00') {
		return;
	}
	$time = strtotime($string);
	if($time == 0) {
		return;
	}

	$localtimezone = intval(date('Z'));
	$clienttimezone = isset($_COOKIE['timeOffset'])?intval($_COOKIE['timeOffset'])*60:$localtimezone;

	$time_diff = $clienttimezone - $localtimezone;

	return date($format,$time + $time_diff);
}
?>